FROM python:3
# 设置下载包的阿里镜像
RUN mkdir -p /root/.pip && printf "[global]" \
    "timeout = 600" \
    "index.url = http://mirrors.aliyun.com/pypi/simple" \
    "trusted-host = mirrors.aliyun.com" \
     | tee -a /root/.pip/pip.conf

# 拷贝./目录到docker的/app目录，app不存在则新建
COPY ./ /app
#将工作目录设置为 /app
WORKDIR /app

# 运行命令，升级pip3，安装requirements.txt需要的包
RUN pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
RUN pip3 install -r /app/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/